<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="include :: header('信件工单-审定')"/>
  <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/qxEasyUI/themes/default/easyui.css}">
</head>
<style>
  .bootstrap-tagsinput > input {
    display: none;
  }
  label {
    font-weight: bold;
  }

  @font-face {
    font-family: 'huawen';
    src: url("/fonts/huawen.woff2");
  }
</style>

<body style="background-color: #F4F6FA;font-size: 13px;font-family:'huawen' ;font-weight: bold">
<div id="admui-siteConTabs " class="main-content" style="margin: 0;padding: 0">

  <form id="form-user-add" class="form-horizontal" th:object="${mmailWorkForm}" style="background-color: #F4F6FA">
    <input type="hidden" name="pkId" id="pkId" th:value="*{pkId}">
    <input type="hidden" name="opAct" id="opAct">
    <div class="col-sm-12" style="display: flex">
      <!--     左       -->
      <div class="col-sm-6 entering-page">
        <!--   来电基本信息     -->
        <div class="col-sm-12 tltieBoder">
          <div class="blueBorder"></div>
          <h4 style="margin:0 0 0 10px">来信人信息</h4>
        </div>
        <!--事发地址-->
        <div class="col-sm-12">
          <div class="form-group">
            <label class="col-sm-2 control-label entering-pd">地区地址：</label>
            <div class="col-sm-8">
              <select name="fmAreaNo" th:field="*{fmAreaNo}" id="fmAreaNo"
                      onchange="dropChgSendTextOnly(this,'fmAreaName');"
                      th:with="district=${@commonServiceImpl.findArea()}" class="form-control formSelect"
                      style="width: 120px;float:left;margin-right: 3px;">
                <option value="">--请选择--</option>
                <option th:each="item : ${district}" th:text="${item['CSText']}"
                        th:value="${item['CSValue']}"></option>
              </select>
              <input name="fmAreaName" id="fmAreaName" type="hidden" th:value="*{fmAreaName}"/>
              <input name="fmAddress" th:field="*{fmAddress}" placeholder="请输入"
                     class="form-control scene theAddress" type="text"
                     maxlength="100" style="width: 200px;float:left;">
            </div>
          </div>
        </div>
        <!-- 来电类型,内容类别..-->
        <div class="col-sm-12">
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label  entering-pd">来信人：</label>
            <div class="col-sm-8">
              <input name="fromName" th:field="*{fromName}" placeholder="请输入"
                     class="form-control scene " type="text">
            </div>
          </div>
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">性别：</label>
            <div class="col-sm-8">
              <label class="check-box">
                <input name="fromSex" th:checked="*{fromSex == '1'}" value="1" type="radio">男
              </label>
              <label class="check-box">
                <input name="fromSex" th:checked="*{fromSex == '0'}" value="0" type="radio">女
              </label>
            </div>
          </div>
        </div>
        <div class="col-sm-12">
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">联系电话：</label>
            <div class="col-sm-8">
              <input name="fromTel" th:field="*{fromTel}" placeholder="请输入"
                     class="form-control scene" type="text">
            </div>
          </div>
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">电子邮件：</label>
            <div class="col-sm-8">
              <input name="fmEmail" th:field="*{fmEmail}" placeholder="请输入"
                     class="form-control scene" type="text">
            </div>
          </div>
        </div>
        <div class="form-group col-sm-12">
          <label class="col-sm-2 control-label entering-pd">流水号：</label>
          <div class="col-sm-9">
            <input name="wsCode" th:field="*{wsCode}" placeholder="请输入"
                   class="form-control workTheme" type="text"
                   disabled>
          </div>
        </div>
        <div class="form-group col-sm-12">
          <label class="col-sm-2 control-label entering-pd">提取码：</label>
          <div class="col-sm-9">
            <input name="wsKey" th:field="*{wsKey}" placeholder="请输入"
                   class="form-control workTheme" type="text"
                   disabled>
          </div>
        </div>
      </div>
      <!--     右       -->
      <div class="col-sm-6 entering-page">
        <div class="col-sm-12">
          <!--   工单基本信息     -->
          <div class="col-sm-12 tltieBoder">
            <div class="blueBorder"></div>
            <h4 style="margin:0 0 0 10px">信件内容整理</h4>
          </div>
          <div class="form-group col-sm-12">
            <label class="col-sm-4 control-label entering-pd">信件来源：</label>
            <div class="col-sm-6">
              <input name="spareString" th:field="*{spareString}" placeholder="请输入"
                     class="form-control workTheme" type="text"
                     disabled>
            </div>
          </div>
          <div class="form-group col-sm-12">
            <label class="col-sm-2 control-label entering-pd">主题：</label>
            <div class="col-sm-10">
              <input name="fromTopic" th:field="*{fromTopic}" placeholder="请输入"
                     class="form-control workTheme" type="text"
                     required="">
            </div>
          </div>
          <div class="col-sm-12" style="margin: 8px 0 8px 0;">
            <div class="form-group">
              <label class="col-xs-2 control-label entering-pd">内容：</label>
              <div class="col-xs-10">
                <!--呈批-->
                <textarea name="fmContent" th:field="*{fmContent}" maxlength="3500"
                          class="form-control workRemark"
                          rows="3" style="height: 100px"></textarea>
              </div>
            </div>
          </div>
          <div class="col-sm-12">
            <div class="form-group col-sm-6">
              <label class="col-sm-4 control-label entering-pd">同意公开：</label>
              <div class="col-xs-8">
                <label class="check-box">
                  <input name="openFrom" th:checked="*{openFrom == 1}" value="1" type="radio">是
                </label>
                <label class="check-box">
                  <input name="openFrom" th:checked="*{openFrom == 0}" value="0" type="radio">否
                </label>
              </div>
            </div>
            <div class="form-group col-sm-6">
              <label class="col-sm-4 control-label entering-pd">来信时间：</label>
              <div class="col-sm-8">
                <input name="fromTime" th:field="*{fromTime}" placeholder="请输入"
                       class="form-control code"
                       type="text" disabled>
              </div>
            </div>
          </div>
          <div class="col-sm-12">
            <div class="form-group col-sm-6">
              <label class="col-sm-4 control-label entering-pd">来信类别：</label>
              <div class="col-sm-8">
                <select name="dfmClaNo" id="dfmClaN"
                        th:with="telTypes=${@commonServiceImpl.findTelType()}"
                        onchange="dropChgSendTextOnly(this,'dfmClaName');"
                        class="form-control formSelect">
                  <option value="">--请选择--</option>
                  <th:block th:each="item : ${telTypes}">
                    <option th:text="${item['CSText']}" th:value="${item['CSValue']}"
                            th:selected="${item['CSValue']} == *{dfmClaNo}"></option>
                  </th:block>
                </select>
                <input type="hidden" name="dfmClaName" id="dfmClaNam" th:value="*{dfmClaName}"/>
              </div>
            </div>
            <div class="form-group col-sm-6">
              <label class="col-sm-4 control-label entering-pd">内容类别：</label>
              <div class="col-sm-8">
                <input id="qxCT" style="width:143px;height:31px;" th:value="*{dcntAName}">
                <input id="txtDcntAcode" name="dcntACode" type="hidden" th:value="*{dcntACode}"/>
                <input id="txtDCntAName" name="dcntAName" type="hidden" th:value="*{dcntAName}"/>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--内下-->
    <div class="col-sm-12" style="display: flex">
      <div class="col-sm-12 entering-page">
        <div class="col-sm-12 tltieBoder">
          <div class="blueBorder"></div>
          <h4 style="margin:0 0 0 10px">工单基本信息</h4>
        </div>
        <div class="col-sm-12">
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">工单编号：</label>
            <div class="col-sm-8">
              <input name="workFormNo" th:field="*{workFormNo}" placeholder="请输入"
                     class="form-control scene theAddress" type="text" disabled>
            </div>
          </div>
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label  entering-pd">工单性质：</label>
            <div class="col-sm-8">
              <select name="setProId" id="setProId" onchange="getSetProName()"
                      th:with="district=${@commonServiceImpl.findWorkFormType()}"
                      class="form-control formSelect">
                <option value="">--请选择--</option>
                <option th:each="item : ${district}" th:text="${item['CSText']}"
                        th:value="${item['CSValue']}"
                        th:selected="${item['CSValue']} == *{setProId}"></option>
              </select>
              <input id="setProName" type="hidden" name="setProName" th:value="*{setProName}"/>
            </div>
          </div>
        </div>
        <div class="col-sm-12">
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">建议公开：</label>
            <div class="col-xs-8">
              <label class="check-box">
                <input name="openX" th:checked="*{openX == 1}" value="1" type="radio">是
              </label>
              <label class="check-box">
                <input name="openX" th:checked="*{openX == 0}" value="0" type="radio">否
              </label>
            </div>
          </div>
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">摘报：</label>
            <div class="col-xs-8">
              <label class="check-box">
                <input name="reportFlag" th:checked="*{reportFlag == 1}" value="1" type="radio">是
              </label>
              <label class="check-box">
                <input name="reportFlag" th:checked="*{reportFlag == 0}" value="0" type="radio">否
              </label>
            </div>
          </div>
        </div>
        <div class="col-sm-12">
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">创建人：</label>
            <div class="col-sm-8">
              <input name="iptWorker" th:field="*{iptWorker}" placeholder="请输入"
                     class="form-control code"
                     type="text" disabled>
              <input name="iptWorkNo" th:field="*{iptWorkNo}" type="hidden">
            </div>
          </div>
          <div class="form-group col-sm-6">
            <label class="col-sm-4 control-label entering-pd">创建时间：</label>
            <div class="col-sm-8">
              <input name="iptTime" th:field="*{iptTime}" placeholder="请输入"
                     class="form-control code"
                     type="text" disabled>
            </div>
          </div>
          <div class="col-sm-12" style="margin: 8px 0 8px 0;">
            <div class="form-group">
              <label class="col-xs-2 control-label entering-pd">工单备注：</label>
              <div class="col-xs-10">
                <!--呈批-->
                <textarea name="wfRemark" maxlength="3500" th:text="*{wfRemark}"
                          class="form-control workRemark"
                          rows="3" style="height: 100px"></textarea>
              </div>
            </div>
          </div>
        </div>
        <!--按钮-->
        <div class="col-sm-12 entering-bt" style="justify-content: center;">
          <button type="button" class="btn btn-sm btn-info" id="btnBack" onclick="btnSbmtClick()">修改
          </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <button type="button" class="btn btn-sm btn-warning" onclick="$.modal.closeTab()">关闭
          </button>&nbsp;
        </div>
      </div>
    </div>

  </form>
</div>

<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/qxEasyUI/jquery.easyui.min.js}"></script>
<script th:src="@{/js/sendDeptList.js}"></script>

<script>
  var prefix = ctx + "system/mMailWF";
  // 选择内容分类
  $('#qxCT').combotree({
    url: '/system/common/findContentCate',
    required: false,
    onSelect: function (record) {
      $("#txtDcntAcode").val(record.id);
      $("#txtDCntAName").val(record.text);
      var dfmClaName = $("#dfmClaNo option:selected").text();
      var fromName = $("#fromName").val();
      $("#wsTopic").val(fromName + '[' + dfmClaName + ']' + record.text);
    }
  });

  $('#dfmClaNo').change(function () {
    var dfmClaName = $("#dfmClaNo option:selected").text();
    var txtDCntAName = $("#txtDCntAName").val();
    var fromName = $("#fromName").val();
    $("#wsTopic").val(fromName + '[' + dfmClaName + ']' + txtDCntAName);
  })

  function getSetProName() {
    var proName = $("#setProId").find("option:selected").text();
    if (proName === '-请选择-') {
      $("#setProName").val("");
    } else {
      $("#setProName").val(proName);
    }
  }

  function btnSbmtClick() {
    if ($.validate.form()) {
      let data = $('#form-user-add').serializeArray();
      $.operate.saveTab(prefix + "/cmnFile/mWFormCreateJson", data);
    }
  }

</script>
</body>
</html>

